<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="jquery-3.7.1.min.js"></script>
    <style>
        * {
            margin: 0;
            padding: 0;
        }

        .box {
            width: 200px;
            height: 200px;
            background-color: red;
            position: relative;
            left: 100px;
            top: 50px;
        }

        .root{
            width: 200px;
            height: 200px;
            background-color: green;
        }
    </style>
</head>

<body>
    <div class="box"></div>
    <div class="root"></div>
    <script>

        //获取元素相对文档的位置 offset->left top  

        var offset = $(".box").offset();
        //console.log(offset);

        $(".root").offset({
            top:offset.top+200,
            left:offset.left
        })


    </script>
</body>

</html>